//
//  LoginNavigationController.m
//  PandaTakeaway
//
//  Created by smufs on 2017/6/30.
//  Copyright © 2017年 李冰. All rights reserved.
//

#import "LoginNavigationController.h"

@interface LoginNavigationController ()

@end

@implementation LoginNavigationController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (instancetype)initWithRootViewController:(UIViewController *)rootViewController {

    if (self = [super initWithRootViewController:rootViewController]) {
                
        UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
        [button setImage:[UIImage imageNamed:@"ic_top_back"] forState:UIControlStateNormal];
        // [button setImage:[UIImage imageNamed:@""] forState:UIControlStateHighlighted];
        button.lb_size = CGSizeMake(30, 30);
        button.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
        [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        [button addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
        rootViewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button];
    }
    
    return self;
}

- (void)back
{
    [self dismissViewControllerAnimated:YES completion:nil];
}

@end
